home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / vdl020d.zip / VNET.DOC < prev    next >
Text File  |  1993-04-14  |  11KB  |  402 lines

  1. {
  2.  ══════════════════════════════════════════════════════════════════════════════
  3.  
  4.  Visionix Network Functions Unit (VNET)
  5.  Copyright 1991,92,93 Visionix
  6.  ALL RIGHTS RESERVED
  7.  
  8.  ──────────────────────────────────────────────────────────────────────────────
  9.  
  10.  Revision history in reverse chronological order:
  11.  
  12.  Initials  Date      Comment
  13.  ────────  ────────  ──────────────────────────────────────────────────────────
  14.  
  15.  lpg       03/16/93  Added Source Documentation
  16.  
  17.  mep       02/11/93  Cleaned up code for beta release
  18.  
  19.  lpg       12/27/92  Started Assemblyizing most of the functions
  20.  
  21.  lpg       12/08/92  Created
  22.  
  23.  ──────────────────────────────────────────────────────────────────────────────
  24.  
  25.   Network Functions Summary
  26.   -------------------------------------------
  27.  
  28.   INT 21h
  29.  
  30.   Func | Sub | Name                      | Use
  31.   -----+-----+---------------------------+--------------------------------------
  32.    44h | 09h | Is Drive Remote           | Reports whether drive leter is local or remote (network)
  33.    44h | 0Ah | Is File or Device Remote  | Reports whether device name is local or remote (network)
  34.  
  35.    5Eh | 00h | Get Machine Name          | Reports network name of the workstation
  36.    5Eh | 02h | Set Printer Setup         | Defines string of chars to be sent with each file to printer
  37.    5Eh | 03h | Get Printer Setup         | Sent with each file to printer
  38.  
  39.    5Fh | 02h | Get Assign List Entry     | Reports IDs and names of drives/devices reassigned to network
  40.    5Fh | 03h | Make Network Connection   | Redirects local drive/device to a network directory/device
  41.    5Fh | 04h | Delete Network Connection | Cancels redirection created with function 5Fh-03h
  42.   -----+-----+---------------------------+--------------------------------------
  43.  
  44.  ──────────────────────────────────────────────────────────────────────────────
  45.  
  46. }
  47.  
  48. Unit VNet;
  49.  
  50.  
  51.  
  52.  
  53.   {
  54.   Function  NW_IsDriveRemote(          Drive     : INTEGER;
  55.                                    Var Remote    : BOOLEAN      ) : WORD;
  56.  
  57.   Function  NW_TestHandleRemote(       Handle    : WORD;
  58.                                    Var Remote    : BOOLEAN      ) : WORD;
  59.  
  60.   Function  NW_SetSharingRetryCnt(     RetryCnt  : WORD;
  61.                                        PauseTime : WORD         ) : WORD;
  62.  
  63.   Function  NW_GetStationName(                                  ) : WORD;
  64.  
  65.   Function  NW_SetPrinterSetup(                                 ) : WORD;
  66.  
  67.   Function  NW_GetPrinterSetup(                                 ) : WORD;
  68.  
  69.   Function  NW_GetAssignList(                                   ) : WORD;
  70.  
  71.   Function  NW_SetNWRedirection(                                ) : WORD;
  72.  
  73.   Function  NW_CancelNWRedirection(                             ) : WORD;
  74.  
  75.  
  76. }
  77.  
  78.   Function  NW_IsDriveRemote(          DriveNum       : BYTE;
  79.                                    VAR ErrCode        : WORD   ) : BOOLEAN;
  80.  
  81.   Function  NW_IsHandleRemote(         Handle         : WORD;
  82.                                    Var ErrCode        : WORD   ) : BOOLEAN;
  83.  
  84.   Procedure NW_SetShareRetryCnt(       RetryCnt       : WORD;
  85.                                        Pause          : WORD;
  86.                                    VAR ErrCode        : WORD   );
  87.  
  88.   Function  NW_GetStationName(     VAR NetName        : STRING;
  89.                                    VAR Valid          : BYTE;
  90.                                    VAR NetBiosNum     : BYTE   ) : WORD;
  91.  
  92.   Function  NW_SetPrinterSetup(        ListIndex      : WORD;
  93.                                        SetupStr       : STRING ) : WORD;
  94.  
  95.   Procedure NW_GetPrinterSetup(        ListIndex      : WORD;
  96.                                    VAR SetupStr       : STRING;
  97.                                    VAR ErrCode        : WORD   );
  98.   (*
  99.                                    VAR SetupString    : POINTER;     { VAR SetupStr : STRING }
  100.                                    VAR StringLen      : WORD;
  101.                                    VAR ErrCode        : WORD   );
  102.   *)
  103.  
  104.   Procedure NW_GetAssignList(          ListIndex      : WORD;
  105.                                    VAR LocalName      : STRING;
  106.                                    VAR NetName        : STRING;
  107.                                    VAR Status         : BYTE;
  108.                                    VAR Code           : BYTE;
  109.                                    VAR ErrCode        : WORD   );
  110.   (*
  111.                                    VAR LocalList      : POINTER;
  112.                                    VAR NetList        : POINTER;
  113.                                    VAR Status         : BYTE;
  114.                                    VAR Code           : BYTE;
  115.                                    VAR ErrCode        : WORD   ) : WORD;
  116.   *)
  117.  
  118.   Function  NW_SetNWRedirection(       DevCode        : BYTE;
  119.                                        LocalName      : STRING;
  120.                                        NetName        : STRING;
  121.                                        Password       : STRING ) : WORD;
  122.  
  123.   Function  NW_CancelNWRedirection(    DevName        : STRING ) : WORD;
  124.  
  125.  
  126.  
  127. ──────────────────────────────────────────────────────────────────────────────
  128.  
  129.  
  130. [FUNCTION]
  131.  
  132. Function NW_IsDriveRemote(   DriveNum  : BYTE;
  133.                          VAR ErrCode   : WORD         ) : BOOLEAN;
  134.  
  135. [PARAMETERS]
  136.  
  137. DriveNum    Drive Number (0=def,1=A,2=B,..)
  138. ErrCode     VAR Returned Error Code (0=Success)
  139.  
  140. [RETURNS]
  141.  
  142. Function : Whether Drive is Remote (Network) or Local.  (TRUE=Remote)
  143. (VAR     : [ErrCode] Error Code
  144.  
  145. [DESCRIPTION]
  146.  
  147. Determines whether a device is local or remote (Network).
  148.  
  149. [SEE-ALSO]
  150.  
  151. [EXAMPLE]
  152.  
  153.  
  154. ──────────────────────────────────────────────────────────────────────────────
  155.  
  156.  
  157. [FUNCTION]
  158.  
  159. Function NW_IsHandleRemote(  Handle    : WORD;
  160.                          Var ErrCode   : WORD         ) : BOOLEAN;
  161.  
  162. [PARAMETERS]
  163.  
  164. Handle      File Handle
  165. ErrCode     VAR Returned Error Code (0=Success)
  166.  
  167. [RETURNS]
  168.  
  169. Function : Whether handle is Remote (NetWork) or Local.  (TRUE=Remote)
  170. (VAR     : [ErrCode] Error Code)
  171.  
  172. [DESCRIPTION]
  173.  
  174. [SEE-ALSO]
  175.  
  176. [EXAMPLE]
  177.  
  178.  
  179. ──────────────────────────────────────────────────────────────────────────────
  180.  
  181.  
  182. [FUNCTION]
  183.  
  184. Procedure NW_SetShareRetryCnt( RetryCnt  : WORD;
  185.                                Pause     : WORD;
  186.                            VAR ErrCode   : WORD       );
  187.  
  188. [PARAMETERS]
  189.  
  190. RetryCnt    Number of Time to Retry on Fail
  191. Pause       Wait Time between Retries in Milliseconds
  192. ErrCode     VAR Returned Error Code (0=Success)
  193.  
  194. [RETURNS]
  195.  
  196. Function : None
  197. (VAR     : [ErrCode] Error Code)
  198.  
  199. [DESCRIPTION]
  200.  
  201. Set number of times DOS retries a file sharing operation
  202.  
  203. NOTE: This function may be called ONLY if Networking SW is Installed.
  204.  
  205. Default is 1 Loop, 3 Retries.  Pause depends upon computer clock speed.
  206.  
  207. [SEE-ALSO]
  208.  
  209. [EXAMPLE]
  210.  
  211.  
  212. ──────────────────────────────────────────────────────────────────────────────
  213.  
  214.  
  215. [FUNCTION]
  216.  
  217. Function NW_GetStationName( VAR NetName    : STRING;
  218.                             VAR Valid      : BYTE;
  219.                             VAR NetBiosNum : BYTE ) : WORD;
  220.  
  221. [PARAMETERS]
  222.  
  223. NetName     VAR Returned Network Name
  224. Valid       VAR Returned Validity Code
  225. NetBiosNum  VAR Returned Network BIOS Number
  226.  
  227. [RETURNS]
  228.  
  229. Function : Status Code (0=Success)
  230. (VAR     : [NetName] Network Name)
  231. (VAR     : [Valid] Validity Code)
  232. (VAR     : [NetBiosNum] Network BIOS Number)
  233.  
  234. [DESCRIPTION]
  235.  
  236. Reports network name of the workstation.
  237. [SEE-ALSO]
  238.  
  239. [EXAMPLE]
  240.  
  241.  
  242. ──────────────────────────────────────────────────────────────────────────────
  243.  
  244.  
  245. [FUNCTION]
  246.  
  247. Function NW_SetPrinterSetup( ListIndex : WORD;
  248.                              SetupStr  : STRING ) : WORD;
  249.  
  250. [PARAMETERS]
  251.  
  252. ListIndex   ?
  253. SetupStr    New Printer Setup String
  254.  
  255. [RETURNS]
  256.  
  257. Status Code (0=Success)
  258.  
  259. [DESCRIPTION]
  260.  
  261. Defines Printer Setup String to be sent with each file to printer.
  262.  
  263. [SEE-ALSO]
  264.  
  265. [EXAMPLE]
  266.  
  267.  
  268. ──────────────────────────────────────────────────────────────────────────────
  269.  
  270.  
  271. [FUNCTION]
  272.  
  273. Procedure NW_GetPrinterSetup( ListIndex   : WORD;
  274.                           VAR SetupStr    : STRING;
  275.                           VAR ErrCode     : WORD    );
  276.  
  277. [PARAMETERS]
  278.  
  279. ListIndex   ?
  280. SetupStr    VAR Returned Printer Setup String
  281. ErrCode     VAR Returned Error Code (0=Success)
  282.  
  283. [RETURNS]
  284.  
  285. Function : None
  286. (VAR     : [SetupStr] Printer Setup String)
  287. (VAR     : [ErrCode] Error Code)
  288.  
  289. [DESCRIPTION]
  290.  
  291. Gets the Printer Setup String which is set with each file to the Printer.
  292.  
  293. [SEE-ALSO]
  294.  
  295. [EXAMPLE]
  296.  
  297.  
  298. ──────────────────────────────────────────────────────────────────────────────
  299.  
  300.  
  301. [FUNCTION]
  302.  
  303. Procedure NW_GetAssignList( ListIndex : WORD;
  304.                         VAR LocalName : STRING;
  305.                         VAR NetName   : STRING;
  306.                         VAR Status    : BYTE;
  307.                         VAR Code      : BYTE;
  308.                         VAR ErrCode   : WORD   );
  309.  
  310. [PARAMETERS]
  311.  
  312. ListIndex   ?
  313. LocalName   VAR Returned Local Name
  314. NetName     VAR Returned Network Name
  315. Status      VAR Returned Device Availability Status
  316. Code        VAR Returned Device Code
  317. ErrCode     VAR Returned Error Code (0=Success)
  318.  
  319. [RETURNS]
  320.  
  321. Function : None
  322. (VAR     : [LocalName] Local Name)
  323. (VAR     : [NetName] Network Name)
  324. (VAR     : [Status] Device Availability Status)
  325. (VAR     : [Code] Device Code)
  326. (VAR     : [ErrCode] Error Code)
  327.  
  328. [DESCRIPTION]
  329.  
  330. LocalList: Pointer to 128-byte buffer returning with the
  331.            Local Name in ASCIIZ format.
  332.  
  333. NetList  : Pointer to 128-byte buffer returning with the
  334.            Network Name in ASCIIZ format.
  335.  
  336. Status   : 0 = Available Network Device
  337.            1 = Temp Unavailable Device
  338.  
  339. Code     : 03 = Printer Device
  340.            04 = Drive Device
  341.  
  342. Reports Names and IDs drives/devices reassigned to the network.
  343.  
  344. [SEE-ALSO]
  345.  
  346. [EXAMPLE]
  347.  
  348.  
  349. ──────────────────────────────────────────────────────────────────────────────
  350.  
  351.  
  352. [FUNCTION]
  353.  
  354. Function NW_SetNWRedirection( DevCode   : BYTE;
  355.                               LocalName : STRING;
  356.                               NetName   : STRING;
  357.                               Password  : STRING  ) : WORD;
  358.  
  359. [PARAMETERS]
  360.  
  361. DevCode     Device Code (03=Printer,04=Drive)
  362. LocalName   Local Name
  363. NetName     Network Name
  364. Password    Network Password
  365.  
  366. [RETURNS]
  367.  
  368. Status Code (0=Success)
  369.  
  370. [DESCRIPTION]
  371.  
  372. Redirects local drive/device to a network directory/device.
  373.  
  374. [SEE-ALSO]
  375.  
  376. [EXAMPLE]
  377.  
  378.  
  379. ──────────────────────────────────────────────────────────────────────────────
  380.  
  381.  
  382. [FUNCTION]
  383.  
  384. Function NW_CancelNWRedirection( DevName : STRING ) : WORD;
  385.  
  386. [PARAMETERS]
  387.  
  388. DevName     16-Character (Max) Source Device Name
  389.  
  390. [RETURNS]
  391.  
  392. Status Code (0=Success)
  393.  
  394. [DESCRIPTION]
  395.  
  396. Cancels redirection created with function NW_SetNWRedirection.
  397.  
  398. [SEE-ALSO]
  399.  
  400. [EXAMPLE]
  401.  
  402.